package com.hrs.common.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import com.hrs.enity.vo.EnumVo;
import lombok.Getter;

import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;

/**
 * @author 计算机系 ITAEM 摆渡人
 * @description
 * @date 2022/11/20 14:54
 */
@Getter
public enum EduBackground {
    PRIMARY(0,"小学"),
    JUNIOR_HIGH(1,"初中"),
    HIGH(2,"高中"),
    PROFESSIONAL_HIGH(3,"职高"),
    HIGH_TECHNOLOGY(4,"高技"),
    TECHNICAL_SECONDARY(5,"中专"),
    JUNIOR_COLLEGE(6,"大专"),
    REGULAR_COLLEGE_COURSE(7,"本科"),
    MASTER_DEGREE_CANDIDATE(8,"硕士研究生"),
    DOCTORAL_CANDIDATE(9,"博士研究生");

    @EnumValue
    private final Integer code;
    private final String display;

    EduBackground(Integer code, String display) {
        this.code = code;
        this.display = display;
    }

    public static List<EnumVo> getEnumVos() {
        List<EnumVo> enumVos = new ArrayList<>();
        EnumSet.allOf(EduBackground.class)
                .forEach(eduBackground -> {
                    EnumVo enumVo = new EnumVo();
                    enumVo.setCode(eduBackground.code);
                    enumVo.setDisplay(eduBackground.display);
                    enumVos.add(enumVo);
                });

        return enumVos;
    }
}
